package edu.java.homework.hw10.tests;

//5.21
public class MyClass5 {
    public static void f() throws B {
	throw new B();
    }

    public static void main(String[] args) throws A {
	try {
	    f();
	}
//	 finally {
//	 System.out.println("Done");
//	 }
	catch (A e) {
	    throw e;
	}

//	finally {
//	    System.out.println("Done");
//	}

    }
}

class A extends Throwable {
}

class B extends A {
}

/*
 * Êàêúâ ïðîáëåì (-è) ùå âúçíèêíå ñ ãîðíèÿ êîä? à) â ìåòîäà main òðÿáâà äà ñå
 * äåêëàðèðà, ÷å õâúðëÿ B à íå A; b) áëîêúò finaly òðÿáâà äà å ñëåä áëîêúò
 * catch; c) â áëîêúò catch òðÿáâà äà å ïîñî÷åíî ÷å ñå "õâàùà" B à íå A; d)
 * äåêëàðàöèÿòà íà êëàñà A å íåïðàâèëíà;
 */

// a) wrong
// b) correct
// c) wrong --> It is correct in this configuration because B "is a" A -type
// exception
// Throwing of the exception in row 12 is unhandles. It is a mistake.